package com.mybatis.mp.scenery.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.api.ApiController;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mybatis.mp.scenery.entity.TActivityOrder;
import com.mybatis.mp.scenery.service.ITActivityOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 * 玩乐门票订单 前端控制器
 * </p>
 *
 * @author baiye
 * @since 2020-02-27
 */
@Controller
@RequestMapping("/scenery/tActivityOrder")
public class TActivityOrderController extends ApiController {

    @Autowired
    private ITActivityOrderService activityOrderService;

    @ResponseBody
    @GetMapping("/page")
    public R<IPage<TActivityOrder>> page(@RequestParam("current") Integer current, @RequestParam("pageSize") Integer pageSize) {
        IPage<TActivityOrder> page = new Page<>(current, pageSize);
        QueryWrapper<TActivityOrder> queryWrapper = new QueryWrapper<>();
        queryWrapper.select("id", "sn", "channel_id", "city_id", "user_id", "user_name", "mobile", "amount", "real_amount", "vendor_amount", "pay_order_sn", "status", "vendor_sn", "is_vip", "created_at", "source_sys", "source_way", "language", "sms_content", "payment_settlement_sn", "refund_settlement_sn");
        return success(activityOrderService.page(page, queryWrapper));
    }

}
